package data.automaton;

import java.util.ArrayList;


//Vertex define
class NodeState {
	String name;
	boolean visit = false;	
	ArrayList<String> neighbors = new ArrayList<String>();

	public NodeState() {
		this.name = "";
	}

	public NodeState(String name) {
		this.name = name;
	}

	public NodeState(String name, ArrayList<String> neighbors) {
		this.name = name;
		this.neighbors = neighbors;
	}

	@Override
	public boolean equals(Object obj) {
		boolean check = false;
		if (obj == null)
			return false;
		else if (obj == this)
			return true;
		else {
			if (obj instanceof NodeState && obj.getClass() == this.getClass()) {
				final NodeState t = (NodeState) obj;
				check = this.name.equals(t.name);
			}
		}
		return check;
	}

	@Override
	public int hashCode() {
		int hash = 7;
		hash = (37 * hash) + (null == this.name ? 0 : this.name.hashCode());
		return hash;
	}
}